 abstract class Employee{
    int earnings;
     public abstract void earnings();
        }
  class YearWork extends Employee{
     @Override
     public void earnings() {
         this.earnings=150000;
     }
 }
  class MonthWork extends Employee{
     @Override
     public void earnings() {
         this.earnings=10000*12;
     }
 }
  class WeekWork extends Employee{
     @Override
     public void earnings() {
         this.earnings=2000*52;
     }
 }
 class Company{

        Employee[]m=new Employee[3];
 }
public class Main {
    public static void main(String[] args) {
        Employee a=new MonthWork();
        Employee b=new YearWork();
        Employee c=new WeekWork();
        Company d=new Company();
        a.earnings();
        b.earnings();
        c.earnings();
        d.m[0]=a;
        d.m[1]=b;
        d.m[2]=c;
        System.out.println("公司薪水总额："+(d.m[0].earnings+d.m[1].earnings+d.m[2].earnings));
    }
}